﻿<local:DocumentBase x:Class="WPFExcelReport.FLTCOTS"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
       Height="700" Width="1024" 
       Background="White" 
         Loaded="Window_Loaded"
        Title="FLTCOTS"  
     >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" Height="630" Width="978">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Vertical" Margin="0,0,3,65">
            <WrapPanel Width="968" Height="38">
                <Label Content="Sales order："    Width="117" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtORDER" Width="83" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="1"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Beige" MaxLength="6" FontSize="18" Foreground="#FF141111" Height="33" />
                <Button Content="Query" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="77" Panel.ZIndex="2"
                        Click="btnQuery_Click"/>                
            </WrapPanel>
        </StackPanel>
        <StackPanel Margin="0,35,3,12" Grid.RowSpan="4" Grid.ColumnSpan="2">            
            <WrapPanel Width="972" Height="199">
                <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  Width="969"
                  Height="183"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"                          
                  SelectionChanged="MasterDg_SelectionChanged"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.RowSpan="3" Grid.Row="1" DataContext="{Binding}">
                    <!--VKPKDKOMM	VKPAUFLFD	VKPAUFPOS	VKPKUNDNR	VKPSACHBE	VKPKOLL	VKPART	VKPFARBE	
                    QTY	DNQTY	VKPMEEH	VKPLIEFTERM A.VKPNEUDAT--> 
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="Requir Date" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=VKPKDKOMM}" Header="Customer PO" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="Order#" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="Pos" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=VKPKUNDNR}" Header="Costomer" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="Merchandiser" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPKOLL}" Header="Collection" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="Article" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="Color" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="Order QTY" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=DNQTY}" Header="Allocate KG" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="Unit" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="Enter Date" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="Delay Reason" Width="SizeToCells" MinWidth="40" />
                    </DataGrid.Columns>
                </DataGrid>
            </WrapPanel>
          <WrapPanel Height="381">
                <fd:FilteringDataGrid
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"
                                IsFilteringCaseSensitive="False"
                                AutoGenerateColumns="False"  
                                EnableRowVirtualization="True"  
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" 
                                Opacity="10" 
                                Visibility="Visible"
                                ItemsSource="{Binding}" 
                                Margin="0,2,0,0" 
                                x:Name="dlgABPOS" Height="373" Width="974">
                    <DataGrid.Columns>
                        <!--CO  ORDERTYP  SUPCODE  SUPPLIER  KRS  FLFD  POS  ENTERDATE  STAFF  
                        ARTICLE  VAR  FARBE  UNIT  QTY  ALLQTY BATQTY REQTY  FDATE  EDATE  ENDDATE LASTDATE RECDATE-->
                        <DataGridTextColumn Binding="{Binding Path=CO}" Header="Customer Order" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=ORDERTYP}" Header="Business" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=SUPPLIER}" Header="Supplier" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=KRS}" Header="Type" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=FLFD}" Header="Order#"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=POS}" Header="Pos" Width="SizeToCells" FontSize="12"  MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=ENTERDATE}" Header="Enter Date"  FontSize="12" Width="SizeToCells" MinWidth="40"/>
                        <DataGridTextColumn Binding="{Binding Path=STAFF}" Header="Staff"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="Article"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=VAR}" Header="Var"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=FARBE}" Header="Color"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=UNIT}" Header="Unit"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="Order QTY"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=ALLQTY}" Header="Allocate QTY"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=BATQTY}" Header="Commission QTY"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=REQTY}" Header="Finished QTY"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=FDATE}" Header="Start Date"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=EDATE}" Header="Delivery Date"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=ENDDATE}" Header="End Date"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=LASTDATE}" Header="Lastest Receive"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=RECDATE}" Header="Lastest Production"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                    </DataGrid.Columns>
                    </fd:FilteringDataGrid  >
                   
            </WrapPanel>
        </StackPanel>
       
    </Grid>
</local:DocumentBase>
